SlideShare a Scribd company logo
Class No.11  Data Structures http://ecomputernotes.com
Code for Simulation // print the final avaerage wait time. double avgWait = (totalTime*1.0)/count; cout << &quot;Total time: &quot; << totalTime << endl; cout << “Customer: &quot; << count << endl; cout << &quot;Average wait: &quot; << avgWait << endl; http://ecomputernotes.com
Priority Queue #include &quot;Event.cpp&quot; #define PQMAX 30 class PriorityQueue { public: PriorityQueue() { size = 0; rear = -1; }; ~PriorityQueue() {}; int full(void) { return ( size == PQMAX ) ? 1 : 0; }; http://ecomputernotes.com
Priority Queue Event* remove() { if( size > 0 ) { Event* e = nodes[0];  for(int j=0; j < size-2; j++ ) nodes[j] = nodes[j+1]; size = size-1; rear=rear-1; if( size == 0 ) rear = -1; return e; } return (Event*)NULL; cout << &quot;remove - queue is empty.&quot; << endl; }; http://ecomputernotes.com
Priority Queue int insert(Event* e)  { if( !full() ) { rear = rear+1; nodes[rear] = e; size = size + 1; sortElements(); // in ascending order return 1; } cout << &quot;insert queue is full.&quot; << endl; return 0; }; int length() { return size; }; };  http://ecomputernotes.com
Tree Data Structures ,[object Object],[object Object],Mohammad Aslam Khan Sohail Aslam Javed Aslam Yasmeen Aslam Saad Haaris Qasim Asim Fahd Ahmad Sara Omer http://ecomputernotes.com
Tree Data Structure ,[object Object],[object Object],[object Object],http://ecomputernotes.com
Binary Tree ,[object Object],[object Object],[object Object],[object Object],http://ecomputernotes.com
Binary Tree ,[object Object],A B D H C E F G I http://ecomputernotes.com
Binary Tree A B D H C E F G I Left subtree root Right subtree http://ecomputernotes.com
Binary Tree ,[object Object],A B D H C E F G I Left subtree root Right subtree http://ecomputernotes.com
Binary Tree ,[object Object],A B D H C E F G I Left subtree root http://ecomputernotes.com
Binary Tree ,[object Object],A B D H C E F G I root http://ecomputernotes.com
Binary Tree ,[object Object],A B D H C E F G I root Right subtree http://ecomputernotes.com
Binary Tree ,[object Object],A B D H C E F G I root Right subtree Left subtree http://ecomputernotes.com
Not a Tree ,[object Object],A B D H C E F G I http://ecomputernotes.com
Not a Tree ,[object Object],A B D H C E F G I http://ecomputernotes.com
Not a Tree ,[object Object],A B D H C E F G I http://ecomputernotes.com
Binary Tree: Terminology A B D H C E F G I parent Left descendant Right descendant Leaf nodes Leaf nodes http://ecomputernotes.com
Binary Tree ,[object Object],A B D H C E F G I J K http://ecomputernotes.com
Level of a Binary Tree Node ,[object Object],[object Object],[object Object],[object Object],http://ecomputernotes.com
Level of a Binary Tree Node A B D H C E F G I 1 0 1 2 2 2 3 3 3 Level 0 Level 1 Level 2 Level 3 http://ecomputernotes.com
Complete Binary Tree ,[object Object],A B N C G O 1 0 1 2 3 3 L F M 2 3 3 H D I 2 3 J E K 2 3 http://ecomputernotes.com
Complete Binary Tree A B Level 0: 2 0  nodes H D I E J K C L F M G N O Level 1: 2 1  nodes Level 2: 2 2  nodes Level 3: 2 3  nodes http://ecomputernotes.com
Complete Binary Tree ,[object Object],[object Object],[object Object],j=0 d http://ecomputernotes.com
Complete Binary Tree ,[object Object],[object Object],[object Object],[object Object],http://ecomputernotes.com
Operations on Binary Tree ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],http://ecomputernotes.com

More Related Content

What's hot

Dsc++ unit 3 notes
Dsc++ unit 3 notesDsc++ unit 3 notes
Dsc++ unit 3 notes
Guru Nanak Institute Of Tech
 
Chapter 8 ds
Chapter 8 dsChapter 8 ds
Chapter 8 ds
Hanif Durad
 
Threaded binarytree&heapsort
Threaded binarytree&heapsortThreaded binarytree&heapsort
Threaded binarytree&heapsortSsankett Negi
 
Storage and memory devices grade 4
Storage and memory devices grade 4Storage and memory devices grade 4
Storage and memory devices grade 4
Alpana panda
 
Binary Tree Traversal
Binary Tree TraversalBinary Tree Traversal
Binary Tree Traversal
Dhrumil Panchal
 
Threaded Binary Tree
Threaded Binary TreeThreaded Binary Tree
Threaded Binary Tree
khabbab_h
 
Threaded binary tree
Threaded binary treeThreaded binary tree
Threaded binary tree
ArunaP47
 
(Binary tree)
(Binary tree)(Binary tree)
(Binary tree)
almario1988
 
Trees - Data structures in C/Java
Trees - Data structures in C/JavaTrees - Data structures in C/Java
Trees - Data structures in C/Javageeksrik
 
Full threded binary tree
Full threded binary treeFull threded binary tree
Full threded binary tree
Soham Kansodaria
 
TREE in Data Structures
TREE in Data StructuresTREE in Data Structures
TREE in Data Structures
NARESH GUMMAGUTTA
 
introduction to_trees
introduction to_treesintroduction to_trees
introduction to_trees
Danish Aakash
 
Working with Files
Working with FilesWorking with Files
Working with Files
selcukca84
 
SQL: Querying Multiple Tables
SQL: Querying Multiple TablesSQL: Querying Multiple Tables
SQL: Querying Multiple Tables
RJ Podeschi
 
Lecture 6 tree traversal
Lecture 6 tree traversalLecture 6 tree traversal
Lecture 6 tree traversal
Abirami A
 
Unit – vi tree
Unit – vi   treeUnit – vi   tree
Unit – vi tree
Tribhuvan University
 
Unit 6 tree
Unit   6 treeUnit   6 tree
Unit 6 tree
Dabbal Singh Mahara
 

What's hot (17)

Dsc++ unit 3 notes
Dsc++ unit 3 notesDsc++ unit 3 notes
Dsc++ unit 3 notes
 
Chapter 8 ds
Chapter 8 dsChapter 8 ds
Chapter 8 ds
 
Threaded binarytree&heapsort
Threaded binarytree&heapsortThreaded binarytree&heapsort
Threaded binarytree&heapsort
 
Storage and memory devices grade 4
Storage and memory devices grade 4Storage and memory devices grade 4
Storage and memory devices grade 4
 
Binary Tree Traversal
Binary Tree TraversalBinary Tree Traversal
Binary Tree Traversal
 
Threaded Binary Tree
Threaded Binary TreeThreaded Binary Tree
Threaded Binary Tree
 
Threaded binary tree
Threaded binary treeThreaded binary tree
Threaded binary tree
 
(Binary tree)
(Binary tree)(Binary tree)
(Binary tree)
 
Trees - Data structures in C/Java
Trees - Data structures in C/JavaTrees - Data structures in C/Java
Trees - Data structures in C/Java
 
Full threded binary tree
Full threded binary treeFull threded binary tree
Full threded binary tree
 
TREE in Data Structures
TREE in Data StructuresTREE in Data Structures
TREE in Data Structures
 
introduction to_trees
introduction to_treesintroduction to_trees
introduction to_trees
 
Working with Files
Working with FilesWorking with Files
Working with Files
 
SQL: Querying Multiple Tables
SQL: Querying Multiple TablesSQL: Querying Multiple Tables
SQL: Querying Multiple Tables
 
Lecture 6 tree traversal
Lecture 6 tree traversalLecture 6 tree traversal
Lecture 6 tree traversal
 
Unit – vi tree
Unit – vi   treeUnit – vi   tree
Unit – vi tree
 
Unit 6 tree
Unit   6 treeUnit   6 tree
Unit 6 tree
 

Viewers also liked

computer notes - Data Structures - 28
computer notes - Data Structures - 28computer notes - Data Structures - 28
computer notes - Data Structures - 28ecomputernotes
 
computer notes - Data Structures - 39
computer notes - Data Structures - 39computer notes - Data Structures - 39
computer notes - Data Structures - 39ecomputernotes
 
computer notes - Data Structures - 30
computer notes - Data Structures - 30computer notes - Data Structures - 30
computer notes - Data Structures - 30ecomputernotes
 
Computer notes - Including Constraints
Computer notes - Including ConstraintsComputer notes - Including Constraints
Computer notes - Including Constraintsecomputernotes
 
Data structures cs301 power point slides lecture 03
Data structures   cs301 power point slides lecture 03Data structures   cs301 power point slides lecture 03
Data structures cs301 power point slides lecture 03Nasir Mehmood
 
e computer notes - Advanced subqueries
e computer notes - Advanced subqueriese computer notes - Advanced subqueries
e computer notes - Advanced subqueriesecomputernotes
 
Computer notes - Analysis of Union
Computer notes  - Analysis of Union Computer notes  - Analysis of Union
Computer notes - Analysis of Union
ecomputernotes
 
Function in C
Function in CFunction in C
Function in C
Dr. Abhineet Anand
 
Input Output - Computer Architecture
Input Output - Computer ArchitectureInput Output - Computer Architecture
Input Output - Computer Architecture
Maruf Abdullah (Rion)
 

Viewers also liked (13)

computer notes - Data Structures - 28
computer notes - Data Structures - 28computer notes - Data Structures - 28
computer notes - Data Structures - 28
 
computer notes - Data Structures - 39
computer notes - Data Structures - 39computer notes - Data Structures - 39
computer notes - Data Structures - 39
 
computer notes - Data Structures - 30
computer notes - Data Structures - 30computer notes - Data Structures - 30
computer notes - Data Structures - 30
 
Computer notes - Including Constraints
Computer notes - Including ConstraintsComputer notes - Including Constraints
Computer notes - Including Constraints
 
Data structures cs301 power point slides lecture 03
Data structures   cs301 power point slides lecture 03Data structures   cs301 power point slides lecture 03
Data structures cs301 power point slides lecture 03
 
e computer notes - Advanced subqueries
e computer notes - Advanced subqueriese computer notes - Advanced subqueries
e computer notes - Advanced subqueries
 
Computer notes - Analysis of Union
Computer notes  - Analysis of Union Computer notes  - Analysis of Union
Computer notes - Analysis of Union
 
Parameter passing to_functions_in_c
Parameter passing to_functions_in_cParameter passing to_functions_in_c
Parameter passing to_functions_in_c
 
Functions in C
Functions in CFunctions in C
Functions in C
 
Function in c
Function in cFunction in c
Function in c
 
Function in C
Function in CFunction in C
Function in C
 
Input Output - Computer Architecture
Input Output - Computer ArchitectureInput Output - Computer Architecture
Input Output - Computer Architecture
 
Function in C program
Function in C programFunction in C program
Function in C program
 

Similar to computer notes - Data Structures - 11

Admissions in india 2015
Admissions in india 2015Admissions in india 2015
Admissions in india 2015
Edhole.com
 
Trees in Data Structure
Trees in Data StructureTrees in Data Structure
Trees in Data Structure
Om Prakash
 
Tree and Binary Search tree
Tree and Binary Search treeTree and Binary Search tree
Tree and Binary Search tree
Muhazzab Chouhadry
 
Write a program in Java to implement the ADT Binary Tree part of who.docx
Write a program in Java to implement the ADT Binary Tree part of who.docxWrite a program in Java to implement the ADT Binary Tree part of who.docx
Write a program in Java to implement the ADT Binary Tree part of who.docx
rochellwa9f
 
Basics of Binary Tree and Binary Search Tree.pptx
Basics of Binary Tree and Binary Search Tree.pptxBasics of Binary Tree and Binary Search Tree.pptx
Basics of Binary Tree and Binary Search Tree.pptx
BhagyashriKotame2
 
computer notes - Data Structures - 23
computer notes - Data Structures - 23computer notes - Data Structures - 23
computer notes - Data Structures - 23ecomputernotes
 
computer notes - Data Structures - 13
computer notes - Data Structures - 13computer notes - Data Structures - 13
computer notes - Data Structures - 13ecomputernotes
 
Tree
TreeTree
Tree
bhumish
 
chapter5.PPT
chapter5.PPTchapter5.PPT
chapter5.PPT
SaralaT3
 
Computer notes - Expression Tree
Computer notes - Expression TreeComputer notes - Expression Tree
Computer notes - Expression Tree
ecomputernotes
 
Data Structures
Data StructuresData Structures
Data Structures
Nitesh Bichwani
 
Trees unit 3
Trees unit 3Trees unit 3
Trees unit 3
praveena p
 
Lecture4b dynamic data_structure
Lecture4b dynamic data_structureLecture4b dynamic data_structure
Lecture4b dynamic data_structure
mbadhi barnabas
 
DSA IV Unit.pptx
DSA IV Unit.pptxDSA IV Unit.pptx
DSA IV Unit.pptx
AyeshaTakreem1
 
Please i need help on following program using C++ Language.Add the.pdf
Please i need help on following program using C++ Language.Add the.pdfPlease i need help on following program using C++ Language.Add the.pdf
Please i need help on following program using C++ Language.Add the.pdf
ezzi552
 
Data Structures and Agorithm: DS 10 Binary Search Tree.pptx
Data Structures and Agorithm: DS 10 Binary Search Tree.pptxData Structures and Agorithm: DS 10 Binary Search Tree.pptx
Data Structures and Agorithm: DS 10 Binary Search Tree.pptx
RashidFaridChishti
 
ds 10-Binary Tree.ppt
ds 10-Binary Tree.pptds 10-Binary Tree.ppt
ds 10-Binary Tree.ppt
khitishlpu
 
Final tree.ppt tells about tree presentation
Final tree.ppt tells about tree presentationFinal tree.ppt tells about tree presentation
Final tree.ppt tells about tree presentation
nakulvarshney371
 

Similar to computer notes - Data Structures - 11 (20)

Admissions in india 2015
Admissions in india 2015Admissions in india 2015
Admissions in india 2015
 
Trees in Data Structure
Trees in Data StructureTrees in Data Structure
Trees in Data Structure
 
Unit 3.ppt
Unit 3.pptUnit 3.ppt
Unit 3.ppt
 
Tree and Binary Search tree
Tree and Binary Search treeTree and Binary Search tree
Tree and Binary Search tree
 
Trees
TreesTrees
Trees
 
Write a program in Java to implement the ADT Binary Tree part of who.docx
Write a program in Java to implement the ADT Binary Tree part of who.docxWrite a program in Java to implement the ADT Binary Tree part of who.docx
Write a program in Java to implement the ADT Binary Tree part of who.docx
 
Basics of Binary Tree and Binary Search Tree.pptx
Basics of Binary Tree and Binary Search Tree.pptxBasics of Binary Tree and Binary Search Tree.pptx
Basics of Binary Tree and Binary Search Tree.pptx
 
computer notes - Data Structures - 23
computer notes - Data Structures - 23computer notes - Data Structures - 23
computer notes - Data Structures - 23
 
computer notes - Data Structures - 13
computer notes - Data Structures - 13computer notes - Data Structures - 13
computer notes - Data Structures - 13
 
Tree
TreeTree
Tree
 
chapter5.PPT
chapter5.PPTchapter5.PPT
chapter5.PPT
 
Computer notes - Expression Tree
Computer notes - Expression TreeComputer notes - Expression Tree
Computer notes - Expression Tree
 
Data Structures
Data StructuresData Structures
Data Structures
 
Trees unit 3
Trees unit 3Trees unit 3
Trees unit 3
 
Lecture4b dynamic data_structure
Lecture4b dynamic data_structureLecture4b dynamic data_structure
Lecture4b dynamic data_structure
 
DSA IV Unit.pptx
DSA IV Unit.pptxDSA IV Unit.pptx
DSA IV Unit.pptx
 
Please i need help on following program using C++ Language.Add the.pdf
Please i need help on following program using C++ Language.Add the.pdfPlease i need help on following program using C++ Language.Add the.pdf
Please i need help on following program using C++ Language.Add the.pdf
 
Data Structures and Agorithm: DS 10 Binary Search Tree.pptx
Data Structures and Agorithm: DS 10 Binary Search Tree.pptxData Structures and Agorithm: DS 10 Binary Search Tree.pptx
Data Structures and Agorithm: DS 10 Binary Search Tree.pptx
 
ds 10-Binary Tree.ppt
ds 10-Binary Tree.pptds 10-Binary Tree.ppt
ds 10-Binary Tree.ppt
 
Final tree.ppt tells about tree presentation
Final tree.ppt tells about tree presentationFinal tree.ppt tells about tree presentation
Final tree.ppt tells about tree presentation
 

More from ecomputernotes

computer notes - Data Structures - 20
computer notes - Data Structures - 20computer notes - Data Structures - 20
computer notes - Data Structures - 20ecomputernotes
 
computer notes - Data Structures - 15
computer notes - Data Structures - 15computer notes - Data Structures - 15
computer notes - Data Structures - 15ecomputernotes
 
Computer notes - Date time Functions
Computer notes - Date time FunctionsComputer notes - Date time Functions
Computer notes - Date time Functionsecomputernotes
 
Computer notes - Subqueries
Computer notes - SubqueriesComputer notes - Subqueries
Computer notes - Subqueriesecomputernotes
 
Computer notes - Other Database Objects
Computer notes - Other Database ObjectsComputer notes - Other Database Objects
Computer notes - Other Database Objectsecomputernotes
 
computer notes - Data Structures - 19
computer notes - Data Structures - 19computer notes - Data Structures - 19
computer notes - Data Structures - 19ecomputernotes
 
computer notes - Data Structures - 31
computer notes - Data Structures - 31computer notes - Data Structures - 31
computer notes - Data Structures - 31ecomputernotes
 
computer notes - Data Structures - 4
computer notes - Data Structures - 4computer notes - Data Structures - 4
computer notes - Data Structures - 4ecomputernotes
 
Computer notes - Advanced Subqueries
Computer notes -   Advanced SubqueriesComputer notes -   Advanced Subqueries
Computer notes - Advanced Subqueriesecomputernotes
 
Computer notes - Aggregating Data Using Group Functions
Computer notes - Aggregating Data Using Group FunctionsComputer notes - Aggregating Data Using Group Functions
Computer notes - Aggregating Data Using Group Functionsecomputernotes
 
computer notes - Data Structures - 16
computer notes - Data Structures - 16computer notes - Data Structures - 16
computer notes - Data Structures - 16ecomputernotes
 
computer notes - Data Structures - 22
computer notes - Data Structures - 22computer notes - Data Structures - 22
computer notes - Data Structures - 22ecomputernotes
 
computer notes - Data Structures - 35
computer notes - Data Structures - 35computer notes - Data Structures - 35
computer notes - Data Structures - 35ecomputernotes
 
computer notes - Data Structures - 36
computer notes - Data Structures - 36computer notes - Data Structures - 36
computer notes - Data Structures - 36ecomputernotes
 
Computer notes - Enhancements to the GROUP BY Clause
Computer notes - Enhancements to the GROUP BY ClauseComputer notes - Enhancements to the GROUP BY Clause
Computer notes - Enhancements to the GROUP BY Clauseecomputernotes
 
Computer notes - Manipulating Data
Computer notes - Manipulating DataComputer notes - Manipulating Data
Computer notes - Manipulating Dataecomputernotes
 
Computer notes - Writing Basic SQL SELECT Statements
Computer notes - Writing Basic SQL SELECT StatementsComputer notes - Writing Basic SQL SELECT Statements
Computer notes - Writing Basic SQL SELECT Statementsecomputernotes
 
computer notes - Data Structures - 14
computer notes - Data Structures - 14computer notes - Data Structures - 14
computer notes - Data Structures - 14ecomputernotes
 
computer notes - Data Structures - 10
computer notes - Data Structures - 10computer notes - Data Structures - 10
computer notes - Data Structures - 10ecomputernotes
 
computer notes - Data Structures - 5
computer notes - Data Structures - 5computer notes - Data Structures - 5
computer notes - Data Structures - 5ecomputernotes
 

More from ecomputernotes (20)

computer notes - Data Structures - 20
computer notes - Data Structures - 20computer notes - Data Structures - 20
computer notes - Data Structures - 20
 
computer notes - Data Structures - 15
computer notes - Data Structures - 15computer notes - Data Structures - 15
computer notes - Data Structures - 15
 
Computer notes - Date time Functions
Computer notes - Date time FunctionsComputer notes - Date time Functions
Computer notes - Date time Functions
 
Computer notes - Subqueries
Computer notes - SubqueriesComputer notes - Subqueries
Computer notes - Subqueries
 
Computer notes - Other Database Objects
Computer notes - Other Database ObjectsComputer notes - Other Database Objects
Computer notes - Other Database Objects
 
computer notes - Data Structures - 19
computer notes - Data Structures - 19computer notes - Data Structures - 19
computer notes - Data Structures - 19
 
computer notes - Data Structures - 31
computer notes - Data Structures - 31computer notes - Data Structures - 31
computer notes - Data Structures - 31
 
computer notes - Data Structures - 4
computer notes - Data Structures - 4computer notes - Data Structures - 4
computer notes - Data Structures - 4
 
Computer notes - Advanced Subqueries
Computer notes -   Advanced SubqueriesComputer notes -   Advanced Subqueries
Computer notes - Advanced Subqueries
 
Computer notes - Aggregating Data Using Group Functions
Computer notes - Aggregating Data Using Group FunctionsComputer notes - Aggregating Data Using Group Functions
Computer notes - Aggregating Data Using Group Functions
 
computer notes - Data Structures - 16
computer notes - Data Structures - 16computer notes - Data Structures - 16
computer notes - Data Structures - 16
 
computer notes - Data Structures - 22
computer notes - Data Structures - 22computer notes - Data Structures - 22
computer notes - Data Structures - 22
 
computer notes - Data Structures - 35
computer notes - Data Structures - 35computer notes - Data Structures - 35
computer notes - Data Structures - 35
 
computer notes - Data Structures - 36
computer notes - Data Structures - 36computer notes - Data Structures - 36
computer notes - Data Structures - 36
 
Computer notes - Enhancements to the GROUP BY Clause
Computer notes - Enhancements to the GROUP BY ClauseComputer notes - Enhancements to the GROUP BY Clause
Computer notes - Enhancements to the GROUP BY Clause
 
Computer notes - Manipulating Data
Computer notes - Manipulating DataComputer notes - Manipulating Data
Computer notes - Manipulating Data
 
Computer notes - Writing Basic SQL SELECT Statements
Computer notes - Writing Basic SQL SELECT StatementsComputer notes - Writing Basic SQL SELECT Statements
Computer notes - Writing Basic SQL SELECT Statements
 
computer notes - Data Structures - 14
computer notes - Data Structures - 14computer notes - Data Structures - 14
computer notes - Data Structures - 14
 
computer notes - Data Structures - 10
computer notes - Data Structures - 10computer notes - Data Structures - 10
computer notes - Data Structures - 10
 
computer notes - Data Structures - 5
computer notes - Data Structures - 5computer notes - Data Structures - 5
computer notes - Data Structures - 5
 

Recently uploaded

Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 

Recently uploaded (20)

Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 

computer notes - Data Structures - 11

  • 1. Class No.11 Data Structures http://ecomputernotes.com
  • 2. Code for Simulation // print the final avaerage wait time. double avgWait = (totalTime*1.0)/count; cout << &quot;Total time: &quot; << totalTime << endl; cout << “Customer: &quot; << count << endl; cout << &quot;Average wait: &quot; << avgWait << endl; http://ecomputernotes.com
  • 3. Priority Queue #include &quot;Event.cpp&quot; #define PQMAX 30 class PriorityQueue { public: PriorityQueue() { size = 0; rear = -1; }; ~PriorityQueue() {}; int full(void) { return ( size == PQMAX ) ? 1 : 0; }; http://ecomputernotes.com
  • 4. Priority Queue Event* remove() { if( size > 0 ) { Event* e = nodes[0]; for(int j=0; j < size-2; j++ ) nodes[j] = nodes[j+1]; size = size-1; rear=rear-1; if( size == 0 ) rear = -1; return e; } return (Event*)NULL; cout << &quot;remove - queue is empty.&quot; << endl; }; http://ecomputernotes.com
  • 5. Priority Queue int insert(Event* e) { if( !full() ) { rear = rear+1; nodes[rear] = e; size = size + 1; sortElements(); // in ascending order return 1; } cout << &quot;insert queue is full.&quot; << endl; return 0; }; int length() { return size; }; }; http://ecomputernotes.com
  • 6.
  • 7.
  • 8.
  • 9.
  • 10. Binary Tree A B D H C E F G I Left subtree root Right subtree http://ecomputernotes.com
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19. Binary Tree: Terminology A B D H C E F G I parent Left descendant Right descendant Leaf nodes Leaf nodes http://ecomputernotes.com
  • 20.
  • 21.
  • 22. Level of a Binary Tree Node A B D H C E F G I 1 0 1 2 2 2 3 3 3 Level 0 Level 1 Level 2 Level 3 http://ecomputernotes.com
  • 23.
  • 24. Complete Binary Tree A B Level 0: 2 0 nodes H D I E J K C L F M G N O Level 1: 2 1 nodes Level 2: 2 2 nodes Level 3: 2 3 nodes http://ecomputernotes.com
  • 25.
  • 26.
  • 27.

Editor's Notes

  1. End of lecture 10
  2. End of lecture 11